package org.test

class Product {

	String barcode;
    String description;

    static constraints = {
		barcode(unique:true, blank:false, nullable:false)
    }
    static hasMany = [prices: PriceAssessment]

	@Override
	public String toString() {
		return "${barcode} ${description}";
	}
	
	@Override
	public boolean equalsTo(Object o){
		if (o instanceof Product){
			return ((Product) o).barcode == this.barcode;
		} 
		return false;
	}
	
}
